diff -r -u -N strace-c-original//defs.h strace-c-patched//defs.h
--- strace-c-original//defs.h	2011-09-20 16:09:19.000000000 +0000
+++ strace-c-patched//defs.h	2011-09-20 19:14:14.000000000 +0000
@@ -29,6 +29,8 @@
  *	$Id$
  */
 
+#include <sys/ptrace.h>
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -158,19 +160,10 @@
 #include <asm/ptrace.h>
 #undef __KERNEL__
 #endif
-#ifdef LINUX
-extern long ptrace(int, int, char *, long);
-#else /* !LINUX */
-extern int ptrace(int, int, char *, int, ...);
-#endif /* !LINUX */
 #endif /* !LINUXSPARC */
 #endif /* !SVR4 */
 
 #ifdef LINUX
-#if !defined(__GLIBC__)
-#define	PTRACE_PEEKUSER	PTRACE_PEEKUSR
-#define	PTRACE_POKEUSER	PTRACE_POKEUSR
-#endif
 #ifdef ALPHA
 #  define REG_R0 0
 #  define REG_A0 16
diff -r -u -N strace-c-original//file.c strace-c-patched//file.c
--- strace-c-original//file.c	2011-09-20 16:09:19.000000000 +0000
+++ strace-c-patched//file.c	2011-09-20 19:14:14.000000000 +0000
@@ -177,21 +177,7 @@
 # endif
 #endif
 
-#if HAVE_LONG_LONG_OFF_T
-/*
- * Ugly hacks for systems that have typedef long long off_t
- */
-
-#define stat64 stat
-#define HAVE_STAT64 1	/* Ugly hack */
-
-#define	sys_stat64	sys_stat
-#define sys_fstat64	sys_fstat
-#define sys_lstat64	sys_lstat
-#define sys_lseek64	sys_lseek
-#define sys_truncate64	sys_truncate
-#define sys_ftruncate64	sys_ftruncate
-#endif
+#include "off_t_hack.h"
 
 #ifdef MAJOR_IN_SYSMACROS
 #include <sys/sysmacros.h>
@@ -626,7 +612,7 @@
 }
 #endif
 
-#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
+#if defined (_LFS64_LARGEFILE) || defined ( HAVE_LONG_LONG_OFF_T)
 int
 sys_lseek64(struct tcb *tcp)
 {
@@ -656,7 +642,7 @@
 }
 #endif
 
-#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
+#if defined(_LFS64_LARGEFILE) || defined(HAVE_LONG_LONG_OFF_T)
 int
 sys_truncate64(struct tcb *tcp)
 {
@@ -680,7 +666,7 @@
 }
 #endif
 
-#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
+#if defined (_LFS64_LARGEFILE) || defined (HAVE_LONG_LONG_OFF_T)
 int
 sys_ftruncate64(struct tcb *tcp)
 {
@@ -979,7 +965,8 @@
 }
 #endif
 
-#ifndef HAVE_LONG_LONG_OFF_T
+#if 1
+//#ifndef HAVE_LONG_LONG_OFF_T
 static void
 realprintstat(struct tcb *tcp, struct stat *statbuf)
 {
@@ -2500,7 +2487,7 @@
 }
 
 
-#if _LFS64_LARGEFILE
+#ifdef _LFS64_LARGEFILE
 int
 sys_getdents64(struct tcb *tcp)
 {
@@ -2531,16 +2518,16 @@
 	if (!abbrev(tcp))
 		tprintf("{");
 	for (i = 0; i < len;) {
-		struct dirent64 *d = (struct dirent64 *) &buf[i];
+		struct dirent *d = (struct dirent *) &buf[i];
 #if defined(LINUX) || defined(SVR4)
 		if (!abbrev(tcp)) {
-			tprintf("%s{d_ino=%" PRIu64 ", d_off=%" PRId64 ", ",
+			tprintf("%s{d_ino=%llu, d_off=%lld, ",
 				i ? " " : "",
 				d->d_ino,
 				d->d_off);
 #ifdef LINUX
 			tprintf("d_type=");
-			printxval(direnttypes, d->d_type, "DT_???");
+			printxval(direnttypes, (long)d->d_type, "DT_???");
 			tprintf(", ");
 #endif
 			tprintf("d_reclen=%u, d_name=\"%s\"}",
diff -r -u -N strace-c-original//io.c strace-c-patched//io.c
--- strace-c-original//io.c	2011-09-20 16:09:19.000000000 +0000
+++ strace-c-patched//io.c	2011-09-20 19:14:14.000000000 +0000
@@ -37,15 +37,6 @@
 #include <sys/uio.h>
 #endif
 
-#ifdef HAVE_LONG_LONG_OFF_T
-/*
- * Hacks for systems that have a long long off_t
- */
-
-#define sys_pread64	sys_pread
-#define sys_pwrite64	sys_pwrite
-#endif
-
 int
 sys_read(struct tcb *tcp)
 {
@@ -322,7 +313,7 @@
 		else if (umove(tcp, tcp->u_arg[2], &offset) < 0)
 			tprintf("%#lx", tcp->u_arg[2]);
 		else
-			tprintf("[%lu]", offset);
+			tprintf("[%llu]", (unsigned long long) offset);
 		tprintf(", %lu", tcp->u_arg[3]);
 	}
 	return 0;
diff -r -u -N strace-c-original//mem.c strace-c-patched//mem.c
--- strace-c-original//mem.c	2011-09-20 16:09:19.000000000 +0000
+++ strace-c-patched//mem.c	2011-09-20 19:14:14.000000000 +0000
@@ -231,7 +231,8 @@
 }
 #endif
 
-#if !HAVE_LONG_LONG_OFF_T
+//#if !HAVE_LONG_LONG_OFF_T
+#if 1
 static int
 print_mmap(struct tcb *tcp, long *u_arg, long long offset)
 {
@@ -314,6 +315,9 @@
 }
 #endif
 
+#endif //1
+#if !HAVE_LONG_LONG_OFF_T
+
 int
 sys_mmap(tcp)
 struct tcb *tcp;
diff -r -u -N strace-c-original//net.c strace-c-patched//net.c
--- strace-c-original//net.c	2011-09-20 16:09:19.000000000 +0000
+++ strace-c-patched//net.c	2011-09-20 19:14:14.000000000 +0000
@@ -109,15 +110,6 @@
 #define HAVE_SENDMSG		1		/* HACK - *FIXME* */
 #endif
 
-#ifdef LINUX
-/* Under Linux these are enums so we can't test for them with ifdef. */
-#define IPPROTO_EGP IPPROTO_EGP
-#define IPPROTO_PUP IPPROTO_PUP
-#define IPPROTO_IDP IPPROTO_IDP
-#define IPPROTO_IGMP IPPROTO_IGMP
-#define IPPROTO_RAW IPPROTO_RAW
-#define IPPROTO_MAX IPPROTO_MAX
-#endif
 
 static const struct xlat domains[] = {
 #ifdef PF_AAL5
diff -r -u -N strace-c-original//off_t_hack.h strace-c-patched//off_t_hack.h
--- strace-c-original//off_t_hack.h	1970-01-01 00:00:00.000000000 +0000
+++ strace-c-patched//off_t_hack.h	2011-09-20 19:14:14.000000000 +0000
@@ -0,0 +1,27 @@
+#ifndef OFF_T_HACK
+
+#if HAVE_LONG_LONG_OFF_T
+/*
+ * Ugly hacks for systems that have typedef long long off_t
+ */
+
+#define stat64 stat
+#define HAVE_STAT64 1   /* Ugly hack */
+
+#ifndef _LFS64_LARGEFILE
+#define _LFS64_LARGEFILE
+#endif
+
+#define sys_stat64      sys_stat
+#define sys_fstat64     sys_fstat
+#define sys_lstat64     sys_lstat
+#define sys_lseek64     sys_lseek
+#define sys_truncate64  sys_truncate
+#define sys_ftruncate64 sys_ftruncate
+#define sys_statfs64 sys_statfs
+#define sys_fstatfs64 sys_fstatfs
+
+
+#endif
+
+#endif
diff -r -u -N strace-c-original//signal.c strace-c-patched//signal.c
--- strace-c-original//signal.c	2011-09-20 16:09:19.000000000 +0000
+++ strace-c-patched//signal.c	2011-09-20 19:14:14.000000000 +0000
@@ -37,6 +37,9 @@
 
 #include <stdint.h>
 #include <signal.h>
+
+# define sigmask(sig) (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int))))
+
 #include <sys/user.h>
 #include <fcntl.h>
 
@@ -455,7 +458,7 @@
 
 #endif /* LINUX */
 
-#if __GLIBC_MINOR__ < 1
+#if defined(__GLIBC__) && (__GLIBC_MINOR__ < 1)
 /* Type for data associated with a signal.  */
 typedef union sigval
 {
@@ -1092,6 +1095,7 @@
 #ifdef HAVE_SIGACTION
 
 #ifdef LINUX
+#define __sighandler_t sighandler_t
 struct old_sigaction {
 	__sighandler_t __sa_handler;
 	unsigned long sa_mask;
diff -r -u -N strace-c-original//syscall.c strace-c-patched//syscall.c
--- strace-c-original//syscall.c	2011-09-20 16:09:19.000000000 +0000
+++ strace-c-patched//syscall.c	2011-09-20 19:14:14.000000000 +0000
@@ -111,6 +111,8 @@
 #define TS TRACE_SIGNAL
 #define NF SYSCALL_NEVER_FAILS
 
+#include "off_t_hack.h"
+
 static const struct sysent sysent0[] = {
 #include "syscallent.h"
 };
diff -r -u -N strace-c-original//time.c strace-c-patched//time.c
--- strace-c-original//time.c	2011-09-20 16:09:19.000000000 +0000
+++ strace-c-patched//time.c	2011-09-20 19:14:14.000000000 +0000
@@ -818,7 +818,8 @@
 			/* _pad[0] is the _tid field which might not be
 			   present in the userlevel definition of the
 			   struct.  */
-			tprintf("{%d}", sev._sigev_un._pad[0]);
+//			tprintf("{%d}", sev._sigev_un._pad[0]);
+			tprintf("{%d}", (int) sev.__pad[0]);
 		else if (sev.sigev_notify == SIGEV_THREAD)
 			tprintf("{%p, %p}", sev.sigev_notify_function,
 				sev.sigev_notify_attributes);
